home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / lib / panzer.g < prev    next >
Text File  |  1995-05-04  |  16KB  |  623 lines

  1. (game-module "panzer"
  2.   (title "Panzer")
  3.   (blurb "WW II, the Eastern Front (a tactical-level game)")
  4.   (variants
  5.    (world-seen true)
  6.    (see-all false)
  7.    (world-size (80 40))
  8.    (real-time)
  9. ;   ("One-Minute Turns" one-minute-turns (true (set real-time-per-turn 60)))
  10. ;   ("Ten-Minute Game" ten-minute-game (true (set real-time-for-game 600)))
  11. ;   ("Five-Minute-per-Side Game" five-minute-game (true (set real-time-per-side 300)))
  12.    ("Capture the Town" capture-the-town
  13.     (true
  14.     (add town start-with 1)
  15.     (add u* point-value 0)
  16.     (add town point-value 1)
  17.     ))
  18.    ("Minefields" minefields
  19.     (true
  20.     ;; if this is enabled, the AI gets confused...
  21.     (table independent-density
  22.       (minefield clear 500)
  23.       (minefield woods 100)
  24.       )
  25.     ))
  26.    ("Rougher" rougher
  27.     (true
  28.     (add t* elevation-max 1000)
  29.     ))
  30.    )
  31. )
  32.  
  33. (terrain-type water (color "sky blue") (image-name "water") (char ".")
  34.   (help "open water"))
  35. (terrain-type swamp (color "yellow green") (char "=")
  36.   (help "water, mud and thick vegetation - nearly impassable"))
  37. (terrain-type gully (color "sienna") (char "&")  ; require explicit icon?
  38.   (help ""))
  39. (terrain-type woods (color "green") (image-name "forest") (char "%")
  40.   (help ""))
  41. (terrain-type slope (color "goldenrod") (char "/")
  42.   (help ""))
  43. (terrain-type clear (color "khaki") (char "+")
  44.   (help "open flat ground"))
  45. (terrain-type thick-forest (color "forest green") (image-name "forest")
  46.   (subtype border)
  47.   (help "impassable to both wheeled and tracked vehicles"))
  48. (terrain-type stream (color "blue") (image-name "water")
  49.   (subtype connection) (subtype-x river-x)
  50.   (help ""))
  51. (terrain-type road (color "gray")
  52.   (subtype connection) (subtype-x road-x)
  53.   (help ""))
  54.  
  55. (add (water swamp) liquid true)
  56.  
  57. (define cell-t* (water swamp gully woods slope clear))
  58.  
  59. ;;; Ground is what doesn't require swimming.
  60.  
  61. (define ground (swamp gully clear woods slope))
  62.  
  63. ;;; Vehicles require solid ground.
  64.  
  65. (define solid (gully clear woods slope))
  66.  
  67. ;;; Wheeled vehicles can't deal with woods.
  68.  
  69. (define drivable (gully clear slope))
  70.  
  71. (add t* elevation-min 100)
  72. (add t* elevation-max 300)
  73.  
  74. (area (cell-width 400))
  75.  
  76. (add clear river-chance 5.00)
  77.  
  78. ;;; Definitions of all the unit types.
  79.  
  80. ;;; Random gen should do these in clumps?
  81. (unit-type town (image-name "town20"))
  82. (unit-type block)
  83. (unit-type minefield)
  84. (unit-type cmdpost (name "command post") (image-name "cmd-post")
  85.   (acp-per-turn 1))
  86.  
  87. (add (town block minefield) speed 0)
  88.  
  89. ;;; Russian unit types.
  90.  
  91. (unit-type rmg (name "MG")
  92.   (help "Russian 12.7mm machine gun"))
  93. (unit-type r45 (name "45mm AT")
  94.   (help "Russian 45mm anti-tank"))
  95. (unit-type r57 (name "57mm AT")
  96.   (help "Russian 57mm anti-tank"))
  97. (unit-type r76at (name "76mm AT")
  98.   (help "Russian 76mm anti-tank"))
  99. (unit-type r122 (name "122mm AT")
  100.   (help "Russian 122mm anti-tank - has a long reach"))
  101. (unit-type r76h (name "76mm H")
  102.   (help "Russian 76mm howitzer"))
  103. (unit-type r82m (name "82mm M (Mot)")
  104.   (help "Russian motorized 82mm mortar"))
  105. (unit-type r82 (name "82mm M")
  106.   (help "Russian 82mm mortar"))
  107. (unit-type r120 (name "120mm M(r)")
  108.   (help "Russian 120mm mortar - a powerful long-range hitter"))
  109.  
  110. (define r-arty (rmg r45 r57 r76at r76h r122 r82m r82 r120))
  111.  
  112. (add (r45 r57 r76at r122) image-name "pz-at")
  113. (add rmg image-name "pz-flak")
  114. (add r76h image-name "pz-how")
  115. (add (r82 r82m r120) image-name "pz-mortar")
  116.  
  117. (add r-arty acp-per-turn 1)
  118. (add r-arty speed 0)
  119. (add (r82m r82) speed 2.00)
  120.  
  121. (add r-arty acp-to-fire 1)
  122.  
  123. (add r-arty range ( 6  3  4  5 10 20 12 12 20))
  124.  
  125. (unit-type rengrs (name "engineers(r)") (image-name "engineers"))
  126. (unit-type rrecon (name "recon(r)") (image-name "inf-plt"))
  127. (unit-type rrifle (name "rifle(r)") (image-name "inf-plt"))
  128. (unit-type rguard (name "guards(r)") (image-name "inf-plt"))
  129. (unit-type rsmg (name "submachinegun(r)") (image-name "inf-plt"))
  130.  
  131. (define r-inf (rengrs rrecon rrifle rguard rsmg))
  132.  
  133. (add r-inf acp-per-turn 2)
  134.  
  135. (unit-type rcav (name "cavalry") (image-name "cavalry")
  136.   (acp-per-turn 6))
  137.  
  138. (unit-type rwag (name "wagon(r)"))
  139. (unit-type rtruck (name "truck(r)"))
  140. (unit-type rhalf (name "halftrack(r)"))
  141.  
  142. (define r-transport (rwag rtruck rhalf))
  143.  
  144. (add r-transport acp-per-turn (6 24 20))
  145.  
  146. (unit-type su-152 (name "SU-152") (image-name "su-152"))
  147. (unit-type su-76 (name "SU-76") (image-name "su-76"))
  148. (unit-type su-85 (name "SU-85") (image-name "su-85"))
  149. (unit-type su-100 (name "SU-100") (image-name "su-100"))
  150. (unit-type jsu-122 (name "JSU-122") (image-name "jsu-122"))
  151.  
  152. (define r-td (su-152 su-76 su-85 su-100 jsu-122))
  153.  
  154. (add r-td acp-per-turn (14 18 22 16 14))
  155. (add r-td acp-min (-14 -18 -22 -16 -14))
  156.  
  157. (add r-td acp-to-fire  (14 18 22 16 14))
  158. (add r-td range        (10  5  8  8 10))
  159.  
  160. (unit-type kv85 (name "KV85") (image-name "kv85")
  161.   (help "Early heavy tank"))
  162. (unit-type t34 (name "T-34c") (image-name "t-34c")
  163.   (help "The most common type of Russian tank"))
  164. (unit-type t34/85 (name "T-34/85") (image-name "t-34-85")
  165.   (help "A better T-34"))
  166. (unit-type js2 (name "JS II") (image-name "js-2")
  167.   (help "Heaviest Russian tank, but slow"))
  168.  
  169. (define r-tank (kv85 t34 t34/85 js2))
  170.  
  171. (add r-tank acp-per-turn (20 22 22 16))
  172. (add r-tank acp-min (-20 -22 -22 -16))
  173.  
  174. (add r-tank acp-to-fire  (20 22 22 16))
  175. (add r-tank range        ( 8  6  8  8))
  176.  
  177. (define r-wheeled (rwag rtruck))
  178.  
  179. (define r-tracked (append rhalf r-td r-tank))
  180.  
  181. (define r-vehicle (append r-wheeled r-tracked))
  182.  
  183. (define r-armored (append rhalf r-td r-tank))
  184.  
  185. (define russian (append r-arty r-inf rcav r-transport r-td r-tank))
  186.  
  187. (add russian possible-sides "russian")
  188.  
  189. ;;; German unit types.
  190.  
  191. (unit-type g50 (name "50mm AT")
  192.   (help ""))
  193. (unit-type g75 (name "75mm AT")
  194.   (help ""))
  195. (unit-type g88 (name "88mm AT")
  196.   (help "German 88mm anti-tank"))
  197. (unit-type g20 (name "20mm F")
  198.   (help "German 20mm flak"))
  199. (unit-type g20q (name "20mmQUAD F")
  200.   (help "German 20mm quad flak"))
  201. (unit-type g75h (name "75mm H")
  202.   (help ""))
  203. (unit-type g150 (name "150mm H")
  204.   (help "German 150mm howitzer - hard-hitting but shortish range"))
  205. (unit-type g81 (name "81mm M")
  206.   (help ""))
  207. (unit-type g120 (name "120mm M(g)")
  208.   (help ""))
  209.  
  210. (define g-arty (g50 g75 g88 g20 g20q g75h g150 g81 g120))
  211.  
  212. (add (g50 g75 g88) image-name "pz-at")
  213. (add (g75h g150) image-name "pz-how")
  214. (add (g20 g20q) image-name "pz-flak")
  215. (add (g81 g120) image-name "pz-mortar")
  216.  
  217. (add g-arty acp-per-turn 1)
  218. (add g-arty speed 0)
  219.  
  220. (add g-arty acp-to-fire 1)
  221. (add g-arty range ( 5  6 20 10 10 12 12 12 20))
  222.  
  223. (unit-type gengrs (name "engineers(g)") (image-name "engineers"))
  224. (unit-type gsec (name "security(g)") (image-name "inf-plt"))
  225. (unit-type grifle (name "rifle(g)") (image-name "inf-plt"))
  226. (unit-type gsmg (name "submachinegun(g)") (image-name "inf-plt"))
  227.  
  228. (define g-inf (gengrs gsec grifle gsmg))
  229.  
  230. (add g-inf acp-per-turn 2)
  231.  
  232. (unit-type gwag (name "wagon(g)"))
  233. (unit-type gtruck (name "truck(g)"))
  234. (unit-type ghalf (name "halftrack(g)"))
  235.  
  236. (define g-transport (gwag gtruck ghalf))
  237.  
  238. (add (rwag gwag) image-name "wagon")
  239. (add (rtruck gtruck) image-name "truck")
  240. (add (rhalf ghalf) image-name "halftrack")
  241.  
  242. (add g-transport acp-per-turn (6 24 20))
  243.  
  244. (unit-type sdkfz/1 (name "SdKfz 234/1") (image-name "sdkfz-234-1")
  245.   (help "Weak, but fastest unit in the game"))
  246. (unit-type puma (name "Puma"))
  247. (unit-type sdkfz/4 (name "SdKfz 234/4") (image-name "sdkfz-234-4"))
  248.  
  249. (define g-car (sdkfz/1 puma sdkfz/4))
  250.  
  251. (add g-car acp-per-turn (32 28 28))
  252. (add g-car acp-min (-32 -28 -28))
  253.  
  254. (add g-car acp-to-fire  (32 28 28))
  255. (add g-car range        ( 2  6 13))
  256.  
  257. (unit-type maultier (name "Maultier")
  258.   (help "Second-deadliest in the game, but very vulnerable"))
  259. (unit-type wespe (name "Wespe")
  260.   (help "Longest range in the game, but vulnerable"))
  261. (unit-type hummel (name "Hummel")
  262.   (help "Deadliest unit in the game, but vulnerable"))
  263.  
  264. (define g-spa (maultier wespe hummel))
  265.  
  266. (add g-spa acp-per-turn (20 16 16))
  267. (add g-spa acp-min (-20 -16 -16))
  268.  
  269. (add g-spa acp-to-fire  (20 16 16))
  270. (add g-spa range        (12 32 24))
  271.  
  272. (unit-type gw38 (name "Gw 38"))
  273. (unit-type wirbelwind (name "Wirbelwind"))
  274. (unit-type stuh42 (name "Stu H 42"))
  275. (unit-type marder3 (name "Marder III"))
  276. (unit-type stug3 (name "StuG III"))
  277. (unit-type hetzer (name "Hetzer"))
  278. (unit-type nashorn (name "Nashorn")
  279.   (help "Longer-range TD"))
  280. (unit-type jgdpz4 (name "Jgd Pz IV"))
  281. (unit-type jgdpz5 (name "Jgd Pz V"))
  282. (unit-type jgdpz6 (name "Jgd Pz VI"))
  283.  
  284. (define ww wirbelwind)
  285.  
  286. (define g-td (gw38 ww stuh42 marder3 stug3 hetzer nashorn jgdpz4 jgdpz5 jgdpz6))
  287.  
  288. (add g-td acp-per-turn (12 16 16 16 16 12 16 16 18 10))
  289. (add g-td acp-min (-12 -16 -16 -16 -16 -12 -16 -16 -18 -10))
  290.  
  291. (add g-td acp-to-fire  (12 16 16 16 16 12 16 16 18 10))
  292. (add g-td range        (12 10 12  8  8  8 20 12 12 12))
  293.  
  294. (unit-type lynx (name "Lynx")
  295.   (help "Weak but speedy"))
  296. (unit-type pz4 (name "PzKpfw IV") (image-name "pz-4")
  297.   (help "Most common type of Panzer"))
  298. (unit-type panther (name "Panther")
  299.   (help "All-around best tank"))
  300. (unit-type tiger1 (name "Tiger I") (image-name "tiger-1")
  301.   (help "Powerful but slow tank"))
  302. (unit-type tiger2 (name "Tiger II") (image-name "tiger-2"))
  303.  
  304. (define g-tank (lynx pz4 panther tiger1 tiger2))
  305.  
  306. (add g-tank acp-per-turn (20 16 20 16 12))
  307. (add g-tank acp-min (-20 -16 -20 -16 -12))
  308.  
  309. (add g-tank acp-to-fire  (20 16 20 16 12))
  310. (add g-tank range        ( 4  8 12 10 12))
  311.  
  312. (define g-wheeled (append gwag gtruck g-car))
  313.  
  314. (define g-tracked (append ghalf g-spa g-td g-tank))
  315.  
  316. (define g-vehicle (append g-wheeled g-tracked))
  317.  
  318. (define g-armored (append ghalf g-car g-spa g-td g-tank))
  319.  
  320. (define german (append g-arty g-inf g-transport g-car g-spa g-td g-tank))
  321.  
  322. (add german possible-sides "german")
  323.  
  324. ;;; Non-side-specific type lists.
  325.  
  326. (define arty (append r-arty g-arty))
  327.  
  328. (define inf (append r-inf g-inf))
  329.  
  330. (define engrs (rengrs gengrs))
  331.  
  332. (define transport (append r-transport g-transport))
  333.  
  334. (define wheeled (append r-wheeled g-wheeled))
  335.  
  336. (define tracked (append r-tracked g-tracked))
  337.  
  338. (define vehicle (append r-vehicle g-vehicle))
  339.  
  340. (define armored (append r-armored g-armored))
  341.  
  342. ;;; What happens to tanks that get wrecked.
  343.  
  344. (unit-type wreck (acp-per-turn 0))
  345.  
  346. ;;; Wrecks don't belong to either side.
  347.  
  348. (add wreck possible-sides "independent")
  349.  
  350. ;; This should be the end of type definitions.
  351.  
  352. ;;; Static relationships.
  353.  
  354. (table vanishes-on
  355.   (u* water true)
  356.   (vehicle swamp true)
  357.   )
  358.  
  359. ;; Normal stacking is 4 in a hex.
  360.  
  361. (add ground capacity 4)
  362.  
  363. (table unit-size-in-terrain
  364.   (u* solid 1)
  365.   ((block town) ground 4)  ; towns and blocks fill entire hex
  366.   )
  367.  
  368. ;; Towns can have a higher concentration of units.
  369.  
  370. (add town capacity 8)
  371.  
  372. ;; Trucks, tanks, etc can carry one infantry or artillery unit.
  373.  
  374. (add vehicle capacity 1)
  375.  
  376. (table unit-size-as-occupant
  377.   (u* u* 99)  ; can't be occupants usually
  378.   (r-arty r-vehicle 1)
  379.   (r-inf r-vehicle 1)
  380.   (g-arty g-vehicle 1)
  381.   (g-inf g-vehicle 1)
  382.   (arty town 1)
  383.   (inf town 1)
  384.   (vehicle town 1)
  385. )
  386.  
  387. ;;; Movement parameters.
  388.  
  389. (table mp-to-enter-terrain
  390.   (u* t* 1)
  391.   (u* slope 2)
  392.   (u* road 0)
  393.   (u* water 99)
  394.   (vehicle swamp 99)
  395.   )
  396.  
  397. (table mp-to-leave-terrain
  398.   (u* t* 1)
  399.   (wheeled gully 20)
  400.   (tracked gully 3)
  401.   (u* road 0)
  402.   )
  403.  
  404. (table mp-to-traverse
  405.   (u* road 1)
  406.   )
  407.  
  408. (table mp-to-enter-zoc
  409.   (u* u* -1)
  410.   (u* wreck 10)
  411. ;  (u* minefield 20)
  412.   )
  413.  
  414. ;; Need high cost of entry, takes entire turn, including transport's acp.
  415.  
  416. (table ferry-on-entry
  417.   (r-transport r-arty over-all)
  418.   (g-transport g-arty over-all)
  419.   )
  420.  
  421. ;;; Combat parameters.
  422.  
  423. (table acp-to-attack
  424.   (u* u* 2) ; for now
  425.   )
  426.  
  427. (table acp-to-defend
  428.   (u* u* 2) ; for now
  429.   )
  430.  
  431. ;; In general, hp of 2 is healthy, 1 is crippled, 0 is dead or disappeared.
  432.  
  433. (add u* hp-max 2)
  434. (add town hp-max 30)
  435. (add minefield hp-max 1)
  436. ;; Trucks and wagons pretty much evaporate in this sort
  437. ;; of combat.
  438. (add transport hp-max 1)
  439. ;; However, armored equipment can absorb more punishment.
  440. (add armored hp-max 4)
  441. ;; ...but not halftracks.
  442. (add (rhalf ghalf) hp-max 2)
  443.  
  444. (table hit-chance
  445.   ;; By default, don't allow combat.
  446.   (u* u* 0)
  447.   ;; Minefields almost always hit.
  448.   (minefield u* 90)
  449.   ;; But they're unlikely to catch engineers by surprise.
  450.   (minefield engrs 20)
  451.   (r-arty u* 100)
  452.   (r-arty g-inf 50)
  453.   (r-inf  u* 100)
  454.   (r-inf  g-armored 50)
  455.   (r-td   u* 100)
  456.   (r-td   g-inf 50)
  457.   (r-tank u* 100)
  458.   (r-tank g-inf (50 40 50 60))
  459.   (g-arty u* 100)
  460.   (g-inf  u* 100)
  461.   (g-inf  r-tank 10)
  462.   (g-car  u*  70)
  463.   (g-car  r-inf  30)
  464.   (g-spa  u* 100)
  465.   (g-spa  r-inf 50)
  466.   (g-td   u* 100)
  467.   (g-td r-inf 40)
  468.   (g-tank u* 100)
  469.   (g-tank r-inf 40)
  470.   ;; Nobody can do anything to a burning wreck.
  471.   (u* wreck 0)
  472.   ;; Only engineers can clear minefields.
  473.   (u* minefield 0)
  474.   (engrs minefield 20)
  475.   )
  476.  
  477. (table damage
  478.   (u* u* 0)
  479.   (minefield u* 1)
  480.   (r-arty u* 1)
  481.   (r-inf  u* 1)
  482.   ((rcav rhalf) u* 1)
  483.   (r-td   u* 2)
  484.   (su-152 u* 2)
  485.   (r-tank u* 1)
  486.   (g-arty u* 1)
  487.   (g-inf  u* 1)
  488.   (g-car  u* 1)
  489.   (g-spa  u* 1)
  490.   (g-spa  r-inf 1d2+1)
  491.   (wespe  u* 1d2+2)
  492.   (hummel u* 2d2+2)
  493.   (g-td   u* 1)
  494.   (g-tank u* 1)
  495.   ;; Heavy tanks are more deadly when they connect
  496.   ((js2 tiger1 tiger2) u* 2)
  497.   ;; Nobody can do anything to a burning wreck.
  498.   (u* wreck 0)
  499.   ;; Only engineers can clear minefields.
  500.   (u* minefield 0)
  501.   (engrs minefield 1)
  502.   )
  503.  
  504. (table occupant-combat
  505.   ;; Artillery can't be used from inside trucks etc.
  506.   (arty transport 0)
  507.   ;; (perhaps allow MGs and mortars to fire from halftracks?)
  508.   )
  509.  
  510. ;;; Units eventually bounce back.
  511.  
  512. (add u* hp-recovery 0.50)
  513.  
  514. ;;; Wrecked armored vehicles continue to be exist.
  515.  
  516. (add armored wrecked-type wreck)
  517.  
  518. ;;; Towns are easy to capture, that's why they should be protected.
  519.  
  520. (table capture-chance
  521.   (u* town 100)
  522.   )
  523.  
  524. ;; Minefields clobber any unit trying to pass over them.
  525.  
  526. (add minefield acp-to-detonate 1)
  527.  
  528. (add minefield hp-per-detonation 0)
  529.  
  530. (table detonation-damage-at (minefield u* 1))
  531.  
  532. ;;; Visibility parameters.
  533.  
  534. ;; Everybody sees everything up to about 2 km or so.
  535. ;; (Every unit has *somebody* with binoculars!)
  536.  
  537. (add u* vision-range 8)
  538. ;; No binoculars (or even eyes) for these types though.
  539. (add (block minefield wreck) vision-range -1)
  540.  
  541. ;; Everybody is line-of-sight.
  542.  
  543. (add u* vision-bend 0)
  544.  
  545. ;; Trees go up to about 20m in height.
  546.  
  547. (add (woods thick-forest) thickness 20)
  548.  
  549. ;; All games will have exactly one Russian and one German side.
  550.  
  551. (set side-library '(
  552.   ((name "Russia") (noun "Russian") (adjective "Russian") (class "russian")
  553.    (color "red") (emblem-name "soviet-star") (names-locked true))
  554.   ((name "Germany") (noun "German") (adjective "German") (class "german")
  555.    (color "gray") (emblem-name "german-cross") (names-locked true))
  556.   ))
  557.  
  558. (set sides-min 2)
  559. (set sides-max 2)
  560.  
  561. ;;; The following sets up a simple game, for testing;
  562. ;;; usually this module should be used in a more-or-less
  563. ;;; preset scenario.
  564.  
  565. (set alt-blob-height 1000)
  566. (set alt-blob-size 100)
  567. (set alt-smoothing 10)
  568.  
  569. (add cell-t* alt-percentile-min (  0   5  10  20  90   5))
  570. (add cell-t* alt-percentile-max (  5  10  15  80 100 100))
  571. (add cell-t* wet-percentile-min (  0  50   0  90   0   0))
  572. (add cell-t* wet-percentile-max (100 100  50 100 100 100))
  573.  
  574. (set edge-terrain clear)
  575.  
  576. ;;; This is sort of a "sampler" OB, not particularly realistic.
  577.  
  578. (add (g75 r76at) start-with 2)
  579.  
  580. (add (g150 r122) start-with 1)
  581.  
  582. (add rrifle start-with 4)
  583.  
  584. (add grifle start-with 4)
  585.  
  586. (add rtruck start-with 6)
  587.  
  588. (add gtruck start-with 6)
  589.  
  590. (add (t34 su-76 su-85 su-152) start-with (8 2 2 2))
  591.  
  592. (add (pz4 panther tiger1 wespe hummel) start-with (4 2 1 1 1))
  593.  
  594. (set country-radius-min 5)
  595.  
  596. (set country-separation-min 25)
  597. (set country-separation-max 30)
  598.  
  599. (table road-chance
  600.   (town town 100)
  601.   )
  602.  
  603. (table road-into-chance
  604.   (t* t* 100)
  605.   (t* gully 20)
  606.   (gully t* 20)
  607.   (t* water 10)
  608.   (water water 0)
  609.   )
  610.  
  611. (add u* point-value 1)
  612.  
  613. (set advantage-max 3)
  614.  
  615. (scorekeeper (do last-side-wins))
  616.  
  617. (game-module (instructions "Move fast or die!"))
  618.  
  619. (game-module (design-notes (
  620.   "make shooting be LOS for armor, specify alts for artillery."
  621.   )))
  622.  
  623.